-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom alert markers (for Obsidian Callout style alert) #185
Conversation
6d06a12
to
9e6350d
Compare
> Something more special | ||
|
||
> [!fOoBaR] | ||
> The marker is case-insensitive and turns into Title Case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if it actually is "Title Case",
However since multi-word markers don't currently work in the plugin, it's not super relevant at the moment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed that in Obsidian it's like this:
> [!hello world]
gives Hello world so first letter capitalized only
…dian On Obsidian, if a custom marker is not defined e.g. > [!fooooobarrrrr] It's styled the same as [!NOTE] (icon and color) Thanks @Tweekism for confirming
About custom style classes, I think the option where you do not directly give the color option, but a class name as a good option: For example, this is my renderer-markdown.nvim settings: ``` {
checkbox = {
custom = {
todo = { raw = '[-]', rendered = '', highlight = 'RenderMarkdownTodo', scope_highlight = nil },
rightarrow = { raw = '[>]', rendered = '', highlight = 'RenderMarkdownRightArrow', scope_highlight = nil },
tilde = { raw = '[~]', rendered = '', highlight = 'RenderMarkdownTilde', scope_highlight = nil },
important = { raw = '[!]', rendered = '', highlight = 'RenderMarkdownImportant', scope_highlight = nil },
},
},
callout = {
note = { raw = '[!NOTE]', rendered = ' Note ', highlight = 'RenderMarkdownInfo' },
tip = { raw = '[!TIP]', rendered = ' Tip ', highlight = 'RenderMarkdownSuccess' },
definition = { raw = '[!DEF]', rendered = ' Definition', highlight = 'RenderMarkdownInfo' },
important = { raw = '[!IMPORTANT]', rendered = ' Important ', highlight = 'RenderMarkdownHint' },
warning = { raw = '[!WARNING]', rendered = ' Warning ', highlight = 'RenderMarkdownWarn' },
caution = { raw = '[!CAUTION]', rendered = ' Caution ', highlight = 'RenderMarkdownError' },
-- Obsidian: https://help.obsidian.md/Editing+and+formatting/Callouts
abstract = { raw = '[!ABSTRACT]', rendered = ' Abstract ', highlight = 'RenderMarkdownInfo' },
summary = { raw = '[!SUMMARY]', rendered = ' Summary ', highlight = 'RenderMarkdownInfo' },
-- snip, and more!
},
} I think it's more convenient to just use the colors of other callouts, rather than needing to provide your own RGB value The built-in color classes should just be written somewhere in the documentation. edit: PS, if you are unfamiliar with nvim, "highlight" is basically a name for a color option and the provided ones are those who are built in. |
Hey, thanks for your input. When I have the time, I'll take a good look at what you're saying, and maybe whether the way render-markdown.nvim does it can help as a reference. A little pinched at the moment though sorry 😄 |
Issue: #141
markers: '*'
config.json
, where you can set either octicon by name or svg by pathLimitation of plugin:
Using a custom marker with spaces doesn't work, such as:
@Tweekism tested that on Obsidian this does work (thanks!), and I think it makes a lot of sense so I'd wish it worked here too.
This however works of course:
Feels like more work though.
Consider sending PR to the plugin if it's easy to add.